package com.laoxu.demo.service;

import com.laoxu.demo.dao.UserDao;
import com.laoxu.demo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 用户service
 * @Author laoxu
 * @Date 2019/12/21 10:42
 **/
@Service
public class UserService {
    @Autowired
    UserDao userDao;

    public List<User> getPager(int page, int limit){
        return userDao.getPager(page,limit);
    }

    public List<User> getAllUsers() {
        return userDao.getAllUsers();
    }

    public void addUser(User user) {
        userDao.addUser(user);
    }

    public void delUser(int id) {
        userDao.delUser(id);
    }

    public void delUsers(int[] ids) {
        userDao.delUsers(ids);
    }

    public void updateUser(User user) {
        userDao.updateUser(user);
    }

    public User getById(Integer id){
        return userDao.getById(id);
    }

}
